function upsealouthuokuan(pass,hkid){
	$("#js_loading").show();
	var g={Action:"uphuokuanpaidui",hkid:hkid,paypass:pass};
              $.ajax({
				url :'../page_ajax.asp',
				dataType:"json",
				data:g,
				success : function(k){
					$("#js_loading").hide();
					   if(k.error==0){	
					      creattoast(k.message,"../buyincenter/");
						 }else{					
						  creattoast(k.message,"-");	
						 }
				    }
			    });
}
function showCommentList(tid,g){var e=[];
    for(var d=0,a=g.message.length;d<a;d++){
	  var h=g.message[d];
       e.push('<LI><DIV class="userface"><DIV class="avatar"><img src="'+h.userface+'" onerror="src=/images/face/no_face.png"></DIV>');
       e.push('<div class="levelbg"><span style="width:100%;"></span></div></DIV>');
       e.push('<DIV class="usrinfo"><div class="titleprice">'+h.realname+'<div class="price">');
       e.push('<em>交易数量：</em>'+h.moneygoods+'</div></div>');
       e.push('<div class="timebutton">支付方式:'+h.khhang+' <span class="f-right">需付金额:'+h.moneytotal+'</span></div>');
       e.push('<div class="timebutton">'+h.Adddate);
       e.push('<a href="javascript:;" class="button js-button" data-price="'+h.moneygoods+'" ');
	   if(tid=="801"){
       e.push('  data-face="'+h.userface+'" data-id="'+h.id+'" onclick="sealoutbutton(this)">出售</a></div></DIV></LI>');
	   }else if(tid=="901"){
		   e.push('  data-face="'+h.userface+'" data-id="'+h.id+'" onclick="sealoutbutton(this)">买入</a></div></DIV></LI>');
	   }else{
		   e.push('  data-face="'+h.userface+'" data-id="'+h.id+'"></a></div></DIV></LI>');
	   }
    }
  $("#JS_goods_list").append(e.join(""));
}
function loadComment(tid,page,opt){
	     var g={Action:"GetPagepaycenter",tid:tid,page:page,opt:opt};
              $.ajax({
				url :'/m/page_ajax.asp',
				dataType:"json",
				data:g,
				success : function(k){
					   if (k.TotalPut>0){
						   if(parseInt(page)<parseInt(k.countpage)){
						   $(".js-more-button").attr("data-page",parseInt(page)+1);
						   }else{$(".js-more-button").hide();}
						  if(parseInt(page)==1){$("#js-loadding-text").hide()}
						  showCommentList(tid,k);						 
						 }else{						
						$("#JS_goods_list").html('<div class="simple-grid-none-data"><span class="text-success-ico icon-info-1"></span><span class="text-success-text">没有查询到符合条件的记录</span></div>');
						
						 }
				    }
			    });
}
/*将收息货币转成计息币*/
function cardtoware(data,cid){
	$("#js_loading").show();
	var g={Action:"cardtoware",cid:cid,pass:data};
              $.ajax({
				url :'../page_ajax.asp',
				dataType:"json",
				data:g,
				success : function(k){
					   $("#js_loading").hide();
					   if (k.error==0){
						  creattoast(k.message,"-");	$("#JS_coupon_"+cid).remove();	$(".close").click();
						 }else{						
						  creattoast(k.message,"-");					
						 }
				    }
			    });
}
/*将收息货币转成可交易币*/
function cardtoseal(data,cid){
	$("#js_loading").show();
	var g={Action:"cardtoseal",cid:cid,pass:data};
              $.ajax({
				url :'../page_ajax.asp',
				dataType:"json",
				data:g,
				success : function(k){
					   $("#js_loading").hide();
					   if (k.error==0){
						  creattoast(k.message,"-");	$("#JS_coupon_"+cid).remove();	$(".close").click();
						 }else{						
						  creattoast(k.message,"-");					
						 }
				    }
			    });
}
function mycardtosealList(tid,g){var e=[];
    for(var d=0,a=g.message.length;d<a;d++){
	  var h=g.message[d];
	 if(tid==701){
		 e.push('<a href="javascript:;" onclick="setcardtoware(this)" id="JS_coupon_'+h.id+'" class="coupon_default coupon_default_v2 bg_blue" data-tid="'+h.id+'">');/*onclick="sealouthuokuan(this)"*/
	 }else{
	   if(h.IsUsed==3){
	     if(h.IsSale==3){
           e.push('<a href="javascript:;" onclick="setcardtoseal(this)" id="JS_coupon_'+h.id+'" class="coupon_default coupon_default_v2 bg_red" data-tid="'+h.id+'">');/*onclick="sealouthuokuan(this)"*/
	     }else if(h.IsSale==5){
		   e.push('<a href="javascript:;" class="coupon_default coupon_default_v2 bg_gold" data-tid="'+h.id+'">');
	     }
	    }else if(h.IsUsed==5){
		  e.push('<a href="javascript:;" class="coupon_default coupon_default_v2 bg_blue" data-tid="'+h.id+'">');
	    }
	 }
       e.push('<div class="coupon_default_inner">');
       e.push('<img class="coupon_default_image"  ');
       e.push('src="../skin/images/huokuanlogo.png" loaded="10"> <p ');
       e.push('class="coupon_default_name"><span class="js-huokuan-id">数字编码：'+h.CardNum+'</span></p><p ');
       e.push('class="coupon_default_pass"><span>数字密钥：'+h.CardPass+'</span></p> <span ');
       e.push('class="coupon_default_price">持仓时间：'+h.UseDate+'</span> <div class="coupon_default_status coupon_default_status_add"> ');
	 if(tid==701){
		 e.push('<span class="coupon_default_status_icon">转入<br>计息</span>');
	 }else{
	   if(h.IsUsed==3){
		   if(h.IsSale==3){
		   e.push('<span class="coupon_default_status_icon">转出<br>交易</span>');
		   }else if(h.IsSale==5){
			  e.push('<span class="coupon_default_status_icon">排队<br>中</span>'); 
		   }
	    }else if(h.IsUsed==5){
		   e.push('<span class="coupon_default_status_icon">锁仓<br>中.</span>');
	    }
	 }
       e.push('<i>持仓'+h.daysum+'天</i></div></div></a>');
    }
  $("#JS_goods_list").append(e.join(""));
}
function mycardtoseal(tid,page,opt){
	     var g={Action:"Getcardcenter",tid:tid,page:page,opt:opt};
              $.ajax({
				url :'../page_ajax.asp',
				dataType:"json",
				data:g,
				success : function(k){
					   if (k.TotalPut>0){
						   if(parseInt(page)<parseInt(k.countpage)){
						   $(".js-more-button").attr("data-page",parseInt(page)+1);
						   }else{
							   $(".js-more-button").hide();}
						  if(parseInt(page)==1){
							  $("#js-loadding-text").hide()}
						  mycardtosealList(tid,k);						 
						 }else{	
						$(".loadmore").hide();
						$("#JS_goods_list").html('<div class="simple-grid-none-data"><span class="text-success-ico icon-info-1"></span><span class="text-success-text">没有查询到符合条件的记录</span></div>');
						
						 }
				    }
			    });
}
function showCommentList(tid,g){var e=[];
    for(var d=0,a=g.message.length;d<a;d++){
	  var h=g.message[d];
       e.push('<LI><DIV class="userface"><DIV class="avatar"><img src="'+h.userface+'" onerror="src=/images/face/no_face.png"></DIV>');
       e.push('<div class="levelbg"><span style="width:100%;"></span></div></DIV>');
       e.push('<DIV class="usrinfo"><div class="titleprice">'+h.realname+'<div class="price">');
       e.push('<em>交易数量：</em>'+h.moneygoods+'</div></div>');
       e.push('<div class="timebutton">支付方式:'+h.khhang+' <span class="f-right">需付金额:'+h.moneytotal+'</span></div>');
       e.push('<div class="timebutton">'+h.Adddate);
       e.push('<a href="javascript:;" class="button js-button" data-price="'+h.moneygoods+'" ');
	   if(tid=="801"){
       e.push('  data-face="'+h.userface+'" data-id="'+h.id+'" onclick="sealoutbutton(this)">出售</a></div></DIV></LI>');
	   }else if(tid=="901"){
		   e.push('  data-face="'+h.userface+'" data-id="'+h.id+'" onclick="sealoutbutton(this)">买入</a></div></DIV></LI>');
	   }else{
		   e.push('  data-face="'+h.userface+'" data-id="'+h.id+'"></a></div></DIV></LI>');
	   }
    }
  $("#JS_goods_list").append(e.join(""));
}
function loadComment(tid,page,opt){
	     var g={Action:"GetPagepaycenter",tid:tid,page:page,opt:opt};
              $.ajax({
				url :'/m/page_ajax.asp',
				dataType:"json",
				data:g,
				success : function(k){
					   if (k.TotalPut>0){
						   if(parseInt(page)<parseInt(k.countpage)){
						   $(".js-more-button").attr("data-page",parseInt(page)+1);
						   }else{$(".js-more-button").hide();}
						  if(parseInt(page)==1){$("#js-loadding-text").hide()}
						  showCommentList(tid,k);						 
						 }else{						
						$("#JS_goods_list").html('<div class="simple-grid-none-data"><span class="text-success-ico icon-info-1"></span><span class="text-success-text">没有查询到符合条件的记录</span></div>');
						
						 }
				    }
			    });
}

function showcardList(tid,g,opt){var e=[];
    for(var d=0,a=g.message.length;d<a;d++){
	  var h=g.message[d];
	  if(h.IsUsed==3){
	     if(h.IsSale==3){
			 if(opt==5){
           e.push('<a href="../suyuan/?UserCardID='+h.id+'" class="coupon_default coupon_default_v2 bg_red" data-tid="'+h.id+'">');/*onclick="sealouthuokuan(this)"*/
			 }else{
				 if(h.CardType==5){
			e.push('<a href="../suyuan/?UserCardID='+h.id+'" class="coupon_default coupon_default_v2 bg_red" data-tid="'+h.id+'">');/*onclick="sealouthuokuan(this)"*/	
				 }else{
			 e.push('<a href="../suyuan/?UserCardID='+h.id+'" class="coupon_default coupon_default_v2 bg_red" data-tid="'+h.id+'">');/*onclick="sealouthuokuan(this)"*/
				 }
			 }
	     }else if(h.IsSale==5){
		   e.push('<a href="../suyuan/?UserCardID='+h.id+'" class="coupon_default coupon_default_v2 bg_gold" data-tid="'+h.id+'">');
	     }
	  }else if(h.IsUsed==5){
		  e.push('<a href="../suyuan/?UserCardID='+h.id+'" class="coupon_default coupon_default_v2 bg_blue" data-tid="'+h.id+'">');
	  }
       e.push('<div class="coupon_default_inner">');
       e.push('<img class="coupon_default_image"  ');
       e.push('src="../skin/images/huokuanlogo.png" loaded="10"> <p ');
       e.push('class="coupon_default_name"><span class="js-huokuan-id">数字编码：'+h.CardNum+'</span></p><p ');
       e.push('class="coupon_default_pass"><span>数字密钥：'+h.CardPass+'</span></p> <span ');
       e.push('class="coupon_default_price">持仓时间：'+h.UseDate+'</span> <div class="coupon_default_status coupon_default_status_add"> ');
	   if(h.IsUsed==3){
		   if(h.IsSale==3){
			   if(opt==5){
		   e.push('<span class="coupon_default_status_icon">排队<br>中</span>');
			   }else{
				  if(h.CardType==5){
					  e.push('<span class="coupon_default_status_icon">排队<br>中</span>');	
				  }else{
			e.push('<span class="coupon_default_status_icon">计息<br>中</span>');	
				  }
			   }
		   }else if(h.IsSale==5){
			  e.push('<span class="coupon_default_status_icon">排队<br>中</span>'); 
		   }
	   }else if(h.IsUsed==5){
		   e.push('<span class="coupon_default_status_icon">锁仓<br>中.</span>');
	   }	   
       e.push('<i>持仓'+h.daysum+'天</i></div></div></a>');
    }
  $("#JS_goods_list").append(e.join(""));
}
function loadmycard(tid,page,opt){
	     var g={Action:"Getcardcenter",tid:tid,page:page,opt:opt};
              $.ajax({
				url :'../page_ajax.asp',
				dataType:"json",
				data:g,
				success : function(k){
					   if (k.TotalPut>0){
						   if(parseInt(page)<parseInt(k.countpage)){
						   $(".js-more-button").attr("data-page",parseInt(page)+1);
						   }else{
							   $(".js-more-button").hide();}
						  if(parseInt(page)==1){
							  $("#js-loadding-text").hide()}
						  showcardList(tid,k,opt);						 
						 }else{						
						$("#JS_goods_list").html('<div class="simple-grid-none-data"><span class="text-success-ico icon-info-1"></span><span class="text-success-text">没有查询到符合条件的记录</span></div>');
						
						 }
				    }
			    });
}
//卖出中心 买入货币
function myformbuyinhuokuan(pass,hkid){
	$("#js_loading").show();
	var g={Action:"buyinhuokuanpaidui",hkid:hkid,paypass:pass};
              $.ajax({
				url :'../page_ajax.asp',
				dataType:"json",
				data:g,
				success : function(k){
					$("#js_loading").hide();
					   if(k.error==0){	
					      creattoast(k.message,"../selloutcenter/");
						 }else{					
						  creattoast(k.message,"-");	
						 }
				    }
			    });
}
function huokuanList(tid,g){var e=[];
    for(var d=0,a=g.message.length;d<a;d++){
	  var h=g.message[d];
	         e.push('<a href="javascript:;" onclick="formbuyinhuokuan(this)" class="coupon_default coupon_default_v2 bg_gold" data-tid="'+h.id+'">');
       e.push('<div class="coupon_default_inner">');
       e.push('<img class="coupon_default_image"  ');
       e.push('src="../skin/images/huokuanlogo.png" loaded="10"> <p ');
       e.push('class="coupon_default_name"><span>'+h.CardNum+'</span></p> <span ');
       e.push('class="coupon_default_price"><em>¥'+h.Money+'</em></span> <div class="coupon_default_status coupon_default_status_add"><span ');
       e.push('class="coupon_default_status_icon">立即<br>买入</span> <i>持仓'+h.daysum+'天</i></div></div></a>');
    }
  $("#JS_goods_list").append(e.join(""));
}
function loadhuokuanlist(tid,page,opt){
	     var g={Action:"gethuokuanlist",tid:tid,page:page,opt:opt};
              $.ajax({
				url :'../page_ajax.asp',
				dataType:"json",
				data:g,
				success : function(k){
					   if (k.TotalPut>0){
						   if(parseInt(page)<parseInt(k.countpage)){
						   $(".js-more-button").attr("data-page",parseInt(page)+1);
						   }else{
							   $(".js-more-button").hide();}
						  if(parseInt(page)==1){
							  $("#js-loadding-text").hide()}
						  huokuanList(tid,k);						 
						 }else{						
						$("#JS_goods_list").html('<div class="simple-grid-none-data"><span class="text-success-ico icon-info-1"></span><span class="text-success-text">没有查询到符合条件的记录</span></div>');
						
						 }
				    }
			    });
}